Create skeleton config.yml
to override defaults.
version: 0.1
log:
fields:
service: registry
storage:
cache:
blobdescriptor: inmemory
filesystem:
rootdirectory: /var/lib/registry
http:
addr: :5000
headers:
X-Content-Type-Options: [nosniff]
auth:
htpasswd:
realm: basic-realm
path: /etc/registry
health:
storagedriver:
enabled: true
interval: 10s
threshold: 3
Generate password for user.
$ htpasswd -Bbn <user> <password>
Insert password into registry container's etc/registry
.
$ docker exec -it registry /bin/sh
$ echo <username>:<password> >> /etc/registry
This can occur when pulling images. To fix from your local machine you must allow insecure access to registries:
Create/modify /etc/docker/daemon.json
adding:
{ "insecure-registries":["registry-hostname:5000"] }
replacing registry-hostname
with the FQDN of your registry server.
Restart the docker daemon.
$ sudo service docker restart